using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using DAL;

namespace BUS
{
   public  class tbHinhThucThanhToanBUS
    {
        public static void Insert(tbHinhThucThanhToan hinhthuctt)
        {
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            hinhthucttDAL.Insert(hinhthuctt);

        }
        public static void Uptate(tbHinhThucThanhToan hinhthuctt)
        {
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            hinhthucttDAL.Update(hinhthuctt);

        }
        public static void Delete(int iD)
        {
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            hinhthucttDAL.Delete(iD);
        }
        public static tbHinhThucThanhToanCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            return hinhthucttDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static tbHinhThucThanhToanCollection GetAll()
        {
            int total = 0;
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            return hinhthucttDAL.Get("where 1=1", 0, 0,
            tbHinhThucThanhToanColumns.MaThanhToan.ToString(),
            "ASC", out total);
        }
        public static tbHinhThucThanhToan GetByID(int iD)
        {
            int total = 0;
            tbHinhThucThanhToanDAL hinhthucttDAL = new tbHinhThucThanhToanDAL();
            tbHinhThucThanhToanCollection hinhthucttCollection = hinhthucttDAL.Get("where " +
            tbHinhThucThanhToanColumns.MaThanhToan.ToString() + "=" + iD.ToString(),
            0, 0, tbHinhThucThanhToanColumns.MaThanhToan.ToString(), "ASC", out total);
            if (hinhthucttCollection.Count > 0)
                return hinhthucttCollection[0];
            return null;
        }

    }
}
